﻿namespace Sidvall.Configuration
{
    public class SettingsManager
    {
        #region Public Members

        public Sidvall.Configuration.ISettings Settings { get; set; }

        #region GetSetting

        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")]
        public object GetSetting(string propertyName)
        {
            if (this.Settings != null)
                return this.Settings.GetSetting(propertyName);
            return null;
        }

        #endregion
        #region SetSetting

        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")]
        public bool SetSetting(string propertyName, object value)
        {
            if (this.Settings != null)
                return this.Settings.SetSetting(propertyName, value);
            return false;
        }

        #endregion

        #region ToString

        public override string ToString()
        {
            return "SettingsManager - Sidvall.Configuration.ISettings";
        }

        #endregion

        #endregion
        #region Constructors

        public SettingsManager(Sidvall.Configuration.ISettings settings)
        {
            this.Settings = settings;
        }

        #endregion
    }
}
